package org.artifact.core;

import org.artifact.core.plugin.netty.NettyPlugin;
import org.artifact.core.plugin.rpc.RpcPlugin;
import org.artifact.core.server.ServerPlugins;
import org.artifact.core.server.bootstrap.DefaultServerBootstrap;
import org.artifact.core.server.mirror.DefaultServerMirror;
import org.artifact.core.server.mirror.ServerMirror;

public class ArtifactDemo {
    /**
     * Demo镜像
     */
    static class DemoServerMirror extends DefaultServerMirror {
        @Override
        public ServerPlugins plugin(ServerPlugins plugins) {
            plugins.load(new NettyPlugin());

//            plugins.load(new RpcPlugin());
            return plugins;
        }
    }


    /**
     * Demo引导
     */
    static class DemoServerBootstrap extends DefaultServerBootstrap {
        @Override
        public ServerMirror getServerMirror() {
            return new DemoServerMirror();
        }
    }

    /**
     * 启动一个Demo服务
     */
    public static void main(String[] args) {
        Artifact.run(new DemoServerBootstrap(),args);
    }
}
